package com.qqtech.qquan.mall.model;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.qqtech.qquan.mall.enums.MallConst;

@SuppressWarnings("serial")
public class MallProductVo extends MallProduct{
	/**
	 * 是否推广
	 */
	private boolean isPromotion;
	/**
	 * 供应商名称
	 */
	public String supplierName;
	/**
	 * 供应商类型
	 */
	public Integer supplierTypeCode;
	/**
	 * 供应商类型
	 */
	public String supplierTypeStr;

	/**
	 * 分类名称
	 */
	public String categoryName;
	
	/**
	 * 产品图片
	 */
	public List<String> imgLst;
	
	/**
	 * 介绍图片
	 */
	public List<String> resumeImgLst;
	
	/**是否被当前登录人关注;1-是,2-否**/
	private java.lang.Integer isConcern;
	
	/** 状态中文:1-下架,2-上架,3-失效 */
	private String statusCn;
	
	/**
	 * 商品规格
	 */
	private List<MallProductSpecVo> productSpecLst;
	/**
	 * 店铺名称
	 */
	public String shopName;
	/**
	 * 店铺类型
	 */
	public Integer shopType;
	
	/** 所在的店铺 */
	private MallShopVo mallShopVo;
	
	public MallShopVo getMallShopVo() {
		return mallShopVo;
	}

	public void setMallShopVo(MallShopVo mallShopVo) {
		this.mallShopVo = mallShopVo;
	}

	public String getShopName() {
		return shopName;
	}

	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	public Integer getShopType() {
		return shopType;
	}

	public void setShopType(Integer shopType) {
		this.shopType = shopType;
	}

	public Integer getSupplierTypeCode() {
		return supplierTypeCode;
	}

	public void setSupplierTypeCode(Integer supplierTypeCode) {
		this.supplierTypeCode = supplierTypeCode;
	}

	public String getSupplierTypeStr() {
		return supplierTypeStr;
	}

	public void setSupplierTypeStr(String supplierTypeStr) {
		this.supplierTypeStr = supplierTypeStr;
	}

	public List<MallProductSpecVo> getProductSpecLst() {
		return productSpecLst;
	}

	public void setProductSpecLst(List<MallProductSpecVo> productSpecLst) {
		this.productSpecLst = productSpecLst;
	}

	
	public String getCategoryName() {
		return categoryName;
	}
	
	public List<String> getImgLst() {
		if (getImg() != null) {
			imgLst = new ArrayList<String>();
			String[] imgs = getImg().split(";");
			for (String i : imgs) {
				imgLst.add(i);
			}
		}
		return imgLst;
	}

	public List<String> getResumeImgLst() {
		if (getResumeImg() != null) {
			resumeImgLst = new ArrayList<String>();
			String[] imgs = getResumeImg().split(";");
			for (String i : imgs) {
				resumeImgLst.add(i);
			}
		}
		return resumeImgLst;
	}
	
	public String getFirstImg() {
		if (getImg() != null) {
			String[] imgs = getImg().split(";");
			return this.getImgHandleDomain() + imgs[0] + MallConst.IMG_SMALL;
		}
		return "";
	}

	public String getSupplierName() {
		return supplierName;
	}

	public boolean getIsPromotion() {
		return isPromotion;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	public void setImgLst(List<String> imgLst) {
		this.imgLst = imgLst;
	}

	public void setIsPromotion(boolean isPromotion) {
		this.isPromotion = isPromotion;
	}

	public void setResumeImgLst(List<String> resumeImgLst) {
		this.resumeImgLst = resumeImgLst;
	}

	public void setSupplierName(String supplierName) {
		this.supplierName = supplierName;
	}
	
	public java.lang.Integer getIsConcern() {
		return isConcern;
	}

	public void setIsConcern(java.lang.Integer isConcern) {
		this.isConcern = isConcern;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}

	public String getStatusCn() {
		return statusCn;
	}

	public void setStatusCn(String statusCn) {
		this.statusCn = statusCn;
	}
}